//
//  ButtonTableViewCell.swift
//  约健
//
//  Created by tyh on 2017/9/18.
//  Copyright © 2017年 tyh. All rights reserved.
//

import UIKit

class ButtonTableViewCell: UITableViewCell {

    var allBtn:UIButton!
    var rumenBtn:UIButton!
    var jingtongBtn:UIButton!
    var cainiaoBtn:UIButton!
    let WIDTH = UIScreen.main.bounds.width
    let HEIGHT = UIScreen.main.bounds.height * 0.05
    let WIDTHboom = UIScreen.main.bounds.width/25
    let HEIGHTboom = (UIScreen.main.bounds.height * 0.05)/10
    override func awakeFromNib() {
        super.awakeFromNib()
        
        allBtn = UIButton()
        allBtn.setTitle("全部", for: .normal)
        allBtn.setTitleColor(UIColor.darkGray, for: .normal)
        self.contentView.addSubview(allBtn)
        
        rumenBtn = UIButton()
        rumenBtn.setTitle("入门", for: .normal)
        rumenBtn.setTitleColor(UIColor.darkGray, for: .normal)
        self.contentView.addSubview(rumenBtn)
        
        cainiaoBtn = UIButton()
        cainiaoBtn.setTitle("菜鸟", for: .normal)
        cainiaoBtn.setTitleColor(UIColor.darkGray, for: .normal)
        self.contentView.addSubview(cainiaoBtn)
        
        jingtongBtn = UIButton()
        jingtongBtn.setTitle("精通", for: .normal)
        jingtongBtn.setTitleColor(UIColor.darkGray, for: .normal)
        self.contentView.addSubview(jingtongBtn)
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        allBtn.frame = CGRect(x: WIDTHboom, y: HEIGHTboom, width: (WIDTH - 5*WIDTHboom)/4, height: HEIGHTboom*8)
        
        rumenBtn.frame = CGRect(x: (2*WIDTHboom)+(WIDTH - 5*WIDTHboom)/4, y: HEIGHTboom, width: (WIDTH - 5*WIDTHboom)/4, height: HEIGHTboom*8)
        
        cainiaoBtn.frame = CGRect(x: (3*WIDTHboom)+(2*(WIDTH - 5*WIDTHboom)/4), y: HEIGHTboom, width: (WIDTH - 5*WIDTHboom)/4, height: HEIGHTboom*8)
        
        jingtongBtn.frame = CGRect(x: (4*WIDTHboom)+(3*(WIDTH - 5*WIDTHboom)/4), y: HEIGHTboom, width: (WIDTH - 5*WIDTHboom)/4, height: HEIGHTboom*8)
        // Configure the view for the selected state
    }

}
